//
//  AliyunPVShareButton.m
//  HYQPlayer-Ali
//
//  Created by zhuxingjian on 2018/7/17.
//  Copyright © 2018年 ZXJ. All rights reserved.
//

#import "AliyunPVShareButton.h"
#import "UIView+AliyunLayout.h"

@implementation AliyunPVShareButton

- (UIImageView *)iconImageView
{
    if (!_iconImageView) {
        _iconImageView = [[UIImageView alloc] init];
        _iconImageView.layer.cornerRadius = 10;
        _iconImageView.layer.masksToBounds = YES;
    }
    return _iconImageView;
}

- (UILabel *)textLabel
{
    if (!_textLabel) {
        _textLabel = [[UILabel alloc] init];
        _textLabel.font = [UIFont systemFontOfSize:12];
        _textLabel.textColor = [UIColor whiteColor];
        _textLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _textLabel;
}

- (instancetype)init
{
    return  [self  initWithFrame:CGRectZero];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.iconImageView];
        [self addSubview:self.textLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.iconImageView.frame = CGRectMake((self.aliyun_width - 52) / 2, 0, 52, 52);
    self.textLabel.frame = CGRectMake(0, self.iconImageView.aliyun_bottom + 10, self.aliyun_width, 30);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
